 // 引入各种公用JS库，配置统一路径
 (function() {
     var libs = [
             'layer.js',
         ],
         baseURL = '/static/js/'; //配置路径
     for (var i = 0, lib; lib = libs[i++];) {
         document.write('<script type="text/javascript" src="' + baseURL + lib + '"></script>');
     }
 })();



 //页面操作
 $(document).ready(function() {

     //判断ie
     var _IE = (function() {
         var v = 3,
             div = document.createElement('div'),
             all = div.getElementsByTagName('i');
         while (div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->', all[0]);
         return v > 4 ? v : false;
     }());

     //IE版本6-8用layer弹提示升级浏览器
     if (_IE > 5 && _IE <= 8) {
         //弹提示层
         layer.confirm('<p class="tc"><strong>您的浏览器版本过低！</strong><br />为了更好的体验，赶快升级您的浏览器！</p>', {
             title: '温馨提示',
             area: '500px',
             btn: ['<i class="mdi mdi-edge mdi-18px"></i>&ensp;升级IE', '不更新&ensp;-_-|||'],
             btnAlign: 'c',
             btn1: function(index, layero) {
                 window.open("https://support.microsoft.com/zh-cn/help/17621/internet-explorer-downloads"); //升级最新IE
                 return false;
             },
             btn2: function(index, layero) {
                 //啥都不做
             }
         });
     }

 });


 //返回顶部
 $("#backtop").click(function() { $("html, body").animate({ scrollTop: 0 }, 500) });

 function backTop() {
     var st = $(document).scrollTop(),
         gt = 500;
     st > gt ? $("#backtop").fadeIn(300) : $("#backtop").fadeOut(300);
 }
 $(window).bind("load scroll resize", backTop);